﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using TS3QueryLib.Core.CommandHandling;

namespace TS3QueryLib.Tests.CommandHandling
{
    [TestClass]
    public class CommandParameterTest
    {
        [TestMethod]
        public void TestOnlyParameterName()
        {
            Assert.AreEqual("secretpassword", new CommandParameter("secretpassword").ToString());
            Assert.AreEqual("secret\\ppassword", new CommandParameter("secret|password").ToString());
        }

        [TestMethod]
        public void TestParameterNameAndValue()
        {
            Assert.AreEqual("key=value", new CommandParameter("key", "value").ToString());
            Assert.AreEqual("key=val\\pue", new CommandParameter("key", "val|ue").ToString());
            Assert.AreEqual("key=val\\sue", new CommandParameter(" key ", " val ue ").ToString());
        }
    }
}